Skip to content

feat(mcp): NitroX Hybrid Model MCP tools (provar.nitrox.*)#112

Merged
mrdailey99 merged 3 commits into
developfrom
feature/nitrox-mcp-tools
Apr 7, 2026
Merged

feat(mcp): NitroX Hybrid Model MCP tools (provar.nitrox.*)#112
mrdailey99 merged 3 commits into
developfrom
feature/nitrox-mcp-tools

Conversation

@mrdailey99
Copy link
Copy Markdown
Collaborator

@mrdailey99 mrdailey99 commented Apr 7, 2026

Summary

New Tools

Tool What it does
provar.nitrox.discover Scan for Provar projects and inventory nitroX/ directories
provar.nitrox.read Read .po.json files for AI context/training
provar.nitrox.validate Validate against NX001–NX010 rules, returns score 0–100
provar.nitrox.generate Generate new .po.json from component description
provar.nitrox.patch Apply RFC 7396 merge-patch to existing .po.json

NitroX is Provar's Hybrid Model for locators — component-based page objects covering LWC, Screen Flow, Industry Components, Experience Cloud, and HTML5.

Test plan

  • yarn test:only — 186 unit tests pass across 5 test files (antTools: 68, automationTools: 40, pathPolicy: 8, qualityHubTools: 26, nitroXTools: 44)
  • node scripts/mcp-smoke.cjs 2>/dev/null — all 38 tools PASS (was 33)
  • yarn compile — TypeScript compiles cleanly
  • Smoke test NitroX tools manually: provar.nitrox.discover with empty search root returns empty projects, not crash
  • Verify provar.nitrox.validate with valid minimal JSON returns score: 100

Notes

  • NitroX validation rules (NX001–NX010) are hardcoded in TypeScript — no runtime schema file loading, CI-safe
  • .gitignore updated to guard FactComponent.schema.json and FactPackage.schema.json (IP-sensitive, not for public repo)
  • Smoke test TOTAL_EXPECTED updated 33 → 38

🤖 Generated with Claude Code

mrdailey99 and others added 2 commits April 7, 2026 13:33
PR #109 added assertPathAllowed checks on input path fields (provar_home,
project_path, results_path) but existing test fixtures used '..' segments
that trigger PATH_TRAVERSAL before the allowedPaths.length guard.

- antTools.test.ts: changed config to allowedPaths:[] and updated
  minimalInput() to use tmpDir-based paths (68 passing, was 26+38 fail)
- automationTools.test.ts: fixed traversal test to use string concat
  instead of path.join (which normalises away '..' segments)
- pathPolicy.test.ts: extracted typed local var to fix TS compile error
  that caused mocha to print help instead of running tests

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds 5 new MCP tools so AI agents can discover, read, validate, generate,
and patch NitroX (Hybrid Model) .po.json component page objects for LWC,
Screen Flow, Industry Components, Experience Cloud, and HTML5.

Tools added:
- provar.nitrox.discover: scan for Provar projects and inventory nitroX/
- provar.nitrox.read: read .po.json files for context/training
- provar.nitrox.validate: validate against NX001-NX010 rules (score 0-100)
- provar.nitrox.generate: generate new .po.json from component description
- provar.nitrox.patch: apply RFC 7396 merge-patch to existing .po.json

Also adds:
- 44 unit tests in nitroXTools.test.ts covering all 5 tools
- 5 smoke test entries (TOTAL_EXPECTED 33->38)
- .gitignore guards for FactComponent/FactPackage schema files
- QualityHub failure detection unit tests (6 new, documenting PR #110 fix)
- README and docs/mcp* updates for NitroX tooling and security model

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 7, 2026 18:34
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds NitroX (Hybrid Model) support to the Provar MCP server so AI agents can discover, read, validate, generate, and patch NitroX .po.json component page objects, along with associated documentation, smoke-test coverage, and unit-test fixes.

Changes:

  • Introduces 5 new MCP tools under provar.nitrox.* (discover/read/validate/generate/patch) and registers them in the MCP server.
  • Adds comprehensive unit tests for NitroX tools and expands smoke coverage; updates/repairs existing unit tests impacted by stricter path policy behavior.
  • Updates MCP documentation and guides to describe NitroX capabilities and path-security details; updates .gitignore for schema/IP-sensitive files.

Reviewed changes

Copilot reviewed 11 out of 13 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
src/mcp/tools/nitroXTools.ts New NitroX tool implementations (discover/read/validate/generate/patch) including validation rules and merge-patch.
src/mcp/server.ts Registers NitroX tools in server startup.
test/unit/mcp/nitroXTools.test.ts New unit tests covering NitroX tools behavior and path policy interactions.
test/unit/mcp/qualityHubTools.test.ts Adds unit tests for Quality Hub failure detection behavior.
test/unit/mcp/antTools.test.ts Updates tests to align with stricter path-policy validation expectations.
test/unit/mcp/automationTools.test.ts Adjusts traversal test to preserve raw .. segments for path-policy enforcement.
test/unit/mcp/pathPolicy.test.ts Minor refactor/clarity change in allowed-dir variable usage.
scripts/mcp-smoke.cjs Extends smoke suite to cover NitroX tools; updates expected tool count.
docs/mcp.md Documents NitroX tools and expands path security section.
docs/mcp-pilot-guide.md Adds NitroX scenario and security-model notes.
README.md Mentions NitroX support in MCP server overview.
.gitignore Ignores NitroX schema artifacts (IP-sensitive).
yarn.lock Lockfile updates (incl. dependency resolution changes).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/mcp/tools/nitroXTools.ts
Comment thread src/mcp/tools/nitroXTools.ts
Comment thread src/mcp/tools/nitroXTools.ts
Comment thread src/mcp/tools/nitroXTools.ts
Comment thread src/mcp/tools/nitroXTools.ts
Comment thread docs/mcp.md
Comment thread test/unit/mcp/nitroXTools.test.ts
…sary type assertions

- Extract root property checks (NX001/NX002/NX003/NX010) into
  validateRootProperties() helper to bring validateNitroXContent
  cyclomatic complexity from 26 to <=20
- Remove redundant 'as string' cast in nitroXTools.test.ts (TypeScript
  narrows after typeof === 'string' type guard)
- Remove redundant 'as string' casts in qualityHubTools.test.ts (same)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@mrdailey99 mrdailey99 merged commit 01c46ab into develop Apr 7, 2026
6 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants